<extend name="Public/base" />
<block name="style">
    
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/default.css" />
           <style>
        .checkmod {
    margin-bottom: 20px;
    border: 1px solid #ebebeb;
}
.checkmod dt {
    padding-left: 30px;
    height: 30px;
    line-height: 30px;
    font-weight: bold;
    border-bottom: 1px solid #ebebeb;
    background-color: #ECECEC;
}
.checkbox, .radio {
display: inline-block;
height: 20px;
line-height: 20px;
}
label {
display:inline}
.checkmod dd {
    padding-left: 50px;
    line-height: 30px;
}
.checkmod dd .checkbox {
    margin: 0 40px 0 0;
}
.checkmod dd .divsion {
    margin-right: 20px;
}
ul{
    margin: 0px;
}
 .nav1 li {
float: left;
position: relative;
margin-left: 0;
list-style: none;
}
.nav1>li>a {
display: block;
}
          .widget-box {
	margin-top: 10px;
}
.tab-nav {
	margin-bottom: 15px;
	padding-left: 1px;
        height: 37px;
	border-bottom: 1px solid #e0e0e0;
}
.tab-nav li {
	margin-bottom: -1px;
	margin-left: -1px;
}
.tab-nav li a,
.tab-nav li a:hover {
	padding: 0 20px;
	height: 35px;
	line-height: 35px;
	font-weight: bold;
	font-size: 16px;
	border: 1px solid transparent;
	border-top-width: 2px;
}
.tab-nav .current a,
.tab-nav .current a:hover {
	border-color: #34b4e0 #e0e0e0 #f6f6f6;
}
.tab-content .tab-pane {
	display: none;
}
.tab-content .in {
	display: block;
}
    </style>
   
</block>
<block name='body'>
			<div class="row">
 


            <!-- Row Start -->
         
              <form action="{:U('AuthGroup/writeGroup')}" method="POST" class="form1 form-horizontal" >
                
            <volist name="node_list" id="node" >
						<dl class="checkmod">
							<dt class="hd">
								<label class="checkbox"><input class="auth_rules rules_all" type="checkbox" name="rules[]" value="<?php echo $main_rules[$node['url']] ?>">{$node.title}管理</label>
							</dt>
							<dd class="bd">
								<present name="node['child']">
								<volist name="node['child']" id="child" >
                                    <div class="rule_check">
                                        <div>
                                            <label class="checkbox" <notempty name="child['tip']">title='{$child.tip}'</notempty>>
                                           <input class="auth_rules rules_row" type="checkbox" name="rules[]" value="<?php echo $auth_rules[$child['url']] ?>"/>{$child.title}
                                            </label>
                                        </div>
                                       <notempty name="child['operator']">
                                           <span class="divsion">&nbsp;</span>
                                           <span class="child_row">
                                               <volist name="child['operator']" id="op">
                                                   <label class="checkbox" <notempty name="op['tip']">title='{$op.tip}'</notempty>>
                                                       <input class="auth_rules" type="checkbox" name="rules[]" value="<?php echo $auth_rules[$op['url']] ?>"/>{$op.title}
                                                   </label>
                                               </volist>
                                           </span>
                                       </notempty>
				                    </div>
								</volist>
								</present>
							</dd>
						</dl>
					</volist>
			         <input type="hidden" name="id" value="{$this_group.id}" />
                                <div class="form-actions">
                    <button type="submit" class="btn btn-success" >确认提交</button>
                    <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
                                </div>
              </form>
            </div>
            <!-- Row End -->           


    




    
</block>

<block name="script">

  <script type="text/javascript">
      
           var rules = [{$this_group.rules}];
        $('.auth_rules').each(function(){
            if( $.inArray( parseInt(this.value,10),rules )>-1 ){
                $(this).prop('checked',true);
            }
            if(this.value==''){
                $(this).closest('span').remove();
            }
        });
$(".hd",".contentpanel").find("input").bind("click",function(){
    
    var obj=$(this);
            if(obj.is(":checked")){
          
                 obj.closest(".checkmod").find("input").attr("checked","checked");
            }else{
                 obj.closest(".checkmod").find("input").removeAttr("checked");
            }
         });
         jQuery(document).ready(function() {		
			Lqw.highlight_subnav("{:U('AuthGroup/index')}");
			App.init(); //Initialise plugins and elements
		});
  </script>    
</block>